/**
 * 
 */
package org.swing.utility.common.datetime;

/**
 * @author lqnhu
 *
 */
public abstract class DateTimePeriodData {
	private final DateTimePeriod period;

	public DateTimePeriodData(DateTimePeriod period) {
		this.period = period;
	}

	public DateTimePeriod getPeriod() {
		return this.period;
	}

	@Override
	public boolean equals(Object object) {
		if (!(object instanceof DateTimePeriodData)) {
			throw new ClassCastException(
					"Can only compare equality with other DateTimePeriodData objects");
		}
		return this.period.equals(((DateTimePeriodData) object).period);
	}

	@Override
	public int hashCode() {
		int hash = 5;
		hash = 79 * hash + (this.period != null ? this.period.hashCode() : 0);
		return hash;
	}
}
